package za.ac.cput.Threadies.Threadies.Impl;

import za.ac.cput.Threadies.Threadies.IntThreadPie;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author User 1
 */
//import java.util.concurrent.*;
//import Threadies.*;
public class ThreadPie implements IntThreadPie{
    double a;
    ThreadTimer timer;
    long b;
    
    public ThreadPie()
    {
        a=0;
        timer = new ThreadTimer();
        timer.run();
        
    }
    public static double calc()
    {
        return (float) Math.IEEEremainder(22,7);
    }
    @Override
    public void run() {
        a = ThreadPie.calc()*100;
        b=timer.getTime();
        System.out.println("Cycles to evaluate PI:"+String.valueOf(getB()));
        try{
        timer.wait();
            this.wait();
        
        }
        catch(Exception e)
        {
            
        }
        finally
        {
            
        }
    
    }
    public double getA(){
        
        return a;
    }
    public long getB(){
        
        return b;
    }
            
}
